import {useGetOptions} from "@/utils/use/use-get-options";
import {DictType} from "@/utils/enum-type";
import {UserItem} from "@/api/sys/dnf/user-item/types";
import {getUserItemListApi} from "@/api/sys/dnf/user-item";

export const useUserItemStore = defineStore('userItem', () => {
  // 货币数据
  const data: Ref<UserItem[]> = ref([])
  let options = useGetOptions(DictType.DnfItemType)
  // options
  const dnfItemTypeOptions = computed(() => options.value[0])

  async function getList() {
    data.value = await getUserItemListApi()
    options = useGetOptions(DictType.DnfItemType)
  }


  return {data,dnfItemTypeOptions,getList }
})
